package com.bobbygu.server.simpleapp.mapper;

import com.bobbygu.server.simpleapp.model.PluginModel;
import org.apache.ibatis.annotations.*;

import java.util.ArrayList;

public interface PluginMapper {
    @Select("select * from plugin")
    ArrayList<PluginModel> getPluginMsg();

    @Select("select * from plugin where name=#{name}")
    PluginModel findPluginByName(String name);

    @Update("update plugin set fileUrl=#{fileUrl} where name=#{name}")
    void updatePluginMsg(@Param("name") String name, @Param("fileUrl") String fileUrl);

    @Insert("insert into plugin(name,fileUrl) values(#{name},#{fileUrl})")
    void insertPluginMsg(@Param("name") String name, @Param("fileUrl") String fileUrl);

    @Delete("delete from plugin where name=#{name}")
    void deletePluginByName(@Param("name") String name);
}
